package easy

var factorys = []int{2, 3, 5}

func IsUgly(n int) bool {
	if n <= 0 {
		return false
	}
	for _, num := range factorys {
		if n%num == 0 {
			n /= num
		}
	}
	return n == 1
}
